@use 'variables' as *;

// 响应式设计 mixins
@mixin respond-to($breakpoint) {
  @if $breakpoint == 'sm' {
    @media (max-width: $breakpoint-sm) { @content; }
  }
  @if $breakpoint == 'md' {
    @media (max-width: $breakpoint-md) { @content; }
  }
  @if $breakpoint == 'lg' {
    @media (max-width: $breakpoint-lg) { @content; }
  }
  @if $breakpoint == 'xl' {
    @media (max-width: $breakpoint-xl) { @content; }
  }
}

// 常用布局 mixins
@mixin flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

@mixin flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@mixin flex-start {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

@mixin flex-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

// 文本处理 mixins
@mixin text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@mixin multi-line-ellipsis($lines: 2) {
  display: -webkit-box;
  -webkit-line-clamp: $lines;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

// 清除浮动
@mixin clearfix {
  &::after {
    content: '';
    display: table;
    clear: both;
  }
}

// 隐藏滚动条但保持功能
@mixin hide-scrollbar {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  &::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
  }
}

// 基础样式
@mixin base-styles {
  html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
  }

  body {
    margin: 0;
    font-family: $base-font-family;
    font-size: $font-size-base;
    font-weight: $base-font-weight;
    line-height: $base-line-height;
    color: $text-primary;
    background-color: $background-light;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
} 